<template>
  <div class="d_main">
    <!-- 操作区 S-->
    <div class="d_operationBox">
      <div class="d_btn">
        <el-radio-group
          v-model="productPlan"
          size="small"
          @change="changePlan"
        >
          <el-radio-button label="0">任务看板</el-radio-button>
          <el-radio-button label="1">生产明细</el-radio-button>
        </el-radio-group>
        <!-- <el-button
          v-show="productPlan === '1'"
          type="primary"
          size="small"
          icon="el-icon-plus"
          @click="showOrder = true"
        >新建
        </el-button> -->
        <selectProductOrder :query-action="2" :per-visible.sync="showOrder" @current="selectCurrentRow" />
      </div>
      <div v-show="productPlan == 1" class="d_search">
      <screec
          v-model="search.QueryDataBaseFiled"
          :headData.sync="tableHead"
          :disabled="searchLoading"
        ></screec>
        <el-input
          v-model="search.likeWords"
          placeholder="产品名称/订单号"
          size="small"
        >
          <el-button
            slot="append"
            :loading="searchLoading"
            type="primary"
            icon="el-icon-search"
            :disabled="searchLoading"
            element-loading-spinner="el-icon-loading"
            @click="getAllMaterils"
          >
            搜索
          </el-button>
        </el-input>
      </div>
    </div>
    <!-- 操作区 E-->
    <!-- 任务看板 S-->
    <div v-show="productPlan == 0" class="taskBox">
      <div class="taskHead">
        <div class="item" v-for="(item, productPlanindex) in planStatus" :key="productPlanindex">
          {{ item }}({{ productPlanList[productPlanindex].length }})
        </div>
      </div>
      <div class="taskContent">
        <div class="item" v-for="(item , index) in productPlanList" :key="index">
          <ul>
            <li v-for="(listitem, listitemIndex) in productPlanList[index]" :key="listitemIndex" @click="toOrdereInfo(listitem)" :class="getClass(listitem)">
              <div class="tit">
                <h3>{{ listitem.orderProductName }}</h3>
              </div>
              <div class="nr">
                <dl>
                  <dt>订单单号</dt>
                  <dd>{{ listitem.xieYiShuHao }}</dd>
                </dl>
                <dl>
                  <dt>板面信息</dt>
                  <dd>{{ listitem.printingSurface + '_' + listitem.productVersion }}</dd>
                </dl>
                <dl>
                  <dt>生产单号</dt>
                  <dd>{{ listitem.produceTaskBillNo }}</dd>
                </dl>
                <dl>
                  <dt>生产类型</dt>
                  <dd>{{ listitem.produceBillType }}</dd>
                </dl>
                <dl>
                  <dt>开单时间</dt>
                  <dd>{{ listitem.openOrderTime }}</dd>
                </dl>
              </div>
              <div class="time">
                <i class="el-icon-time" />
                <span>{{ listitem.deliveryStateWords }}</span>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <!-- 任务看板 E-->
    <!-- 表格操作区 S-->
    <div  v-show="productPlan == 1" class="d_tableOperation">
      <div class="d_condition">

      </div>
      <div class="d_set">
        <div @click="Refresh"><i class="d_icon el-icon-refresh-right" /></div>
        <div class="setting flex">
          <HeadSeting :list-data.sync="tableHead" :table-code="$config.saleorderlist" @reset="getTableHead" />
        </div>
      </div>
    </div>
    <!-- 表格操作区 E-->
    <!--table板块-->
    <div v-show="productPlan == 1" ref="tableCon" class="tableCon">
      <el-table
        v-show="tableHead.length > 0"
        id="emtable"
        ref="multipleTable"
        v-loading="searchLoading"
        :data="allMaterirls"
        :height="tableHeight || 'auto'"
        border
        fit
        style="width: 100%"
        @header-dragend="surverWidth"
      >
        <!-- 复选框       -->
        <!--        <el-table-column type="selection" width="40" fixed="left" />-->
        <template v-for="(fruit, index) in tableHead">
          <el-table-column
            v-if="fruit.visible"
            :key="index"
            :label="fruit.columnName"
            :min-width="fruit.columnWidth || 110"
            :prop="fruit.columnCode"
            show-overflow-tooltip
            :fixed="fruit.isFloat ? 'left' : false"
          >
            <template slot-scope="scope">
              <el-button v-if="fruit.columnCode === 'saleOrderNo'" type="text" @click="checkProductList(scope.row)"> {{ scope.row[fruit.columnCode] }}</el-button>
              <div v-else-if="fruit.columnCode==='produceBillStateName'" class="flex">
                <template v-if="scope.row.produceBillState===0">
                  <span class="mr5 spot" style="background: #3F61F1" />{{ scope.row[fruit.columnCode] }}
                </template>
                <template v-else-if="scope.row.produceBillState===1">
                  <span class="mr5 spot" style="background: #67C23A" />{{ scope.row[fruit.columnCode] }}
                </template>
                <template v-else>
                  <span class="mr5 spot" style="background: #999AAA" />{{ scope.row[fruit.columnCode] }}
                </template>
              </div>
              <div v-else-if="fruit.columnCode==='taskProduceStateName'" class="flex">
                <template v-if="scope.row.taskProduceState===0">
                  <span class="mr5 spot" style="background: #3F61F1" />{{ scope.row[fruit.columnCode] }}
                </template>
                <template v-else-if="scope.row.taskProduceState===1 || scope.row.taskProduceState===4">
                  <span class="mr5 spot" style="background: #67C23A" />{{ scope.row[fruit.columnCode] }}
                </template>
                <template v-else>
                  <span class="mr5 spot" style="background: #E13335" />{{ scope.row[fruit.columnCode] }}
                </template>
              </div>
              <template v-else>
                {{ scope.row[fruit.columnCode] }}
              </template>
            </template>
          </el-table-column>
        </template>
        <el-table-column label="操作" width="70px" fixed="right" align="center">
          <template slot-scope="scope">
            <div>
              <el-popover
                :ref="`popover-${scope.$index}`"
                placement="bottom-end"
                popper-class="tableOp"
                width="160"
                :popper-options="{
                    boundariesElement: 'opBox',
                    removeOnDestroy: true,
                  }"
                trigger="click"
              >
                <div class="operation">
                  <ul>
                    <li @click="checkWork(scope.row)">
                      查看
                    </li>
                    <li v-show="scope.row.craftWorkState === 0" v-permission="'MenuCode2-2-8'" @click="print(scope.row)">
                      修改
                    </li>
                  </ul>
                  <ul>
                    <li v-show="scope.row.craftWorkState === 0" v-permission="'MenuCode2-2-9'" @click="doneWork(scope.row)">
                      完成作业
                    </li>
                  </ul>
                  <ul>
                    <li v-show="scope.row.craftWorkState === 0" v-permission="'MenuCode2-2-10'" @click="stopOne(scope.row)">
                      删除
                    </li>
                  </ul>
                </div>
                <div slot="reference" class="opBox pointer">
                  <span class="el-icon-more c_3F61F1" />
                </div>
              </el-popover>
            </div>
          </template>
        </el-table-column>
      </el-table>
      <!-- 骨架屏     -->
      <div v-if="tableHead.length == 0" class="p16">
        <el-skeleton :rows="6" animated />
      </div>
    </div>
    <!-- 分页 S-->
    <div v-show="productPlan == 1" class="d_pag">
      <pagination
        :total="total || 0"
        :page.sync="search.pageIndex"
        :limit.sync="search.pageSize"
        @pagination="getAllLists"
      />
    </div>
    <!-- 分页 E-->
    <!-- 作废原因   -->
    <el-dialog
      :title="'原因'"
      :visible.sync="reasonVisible"
      :close-on-click-modal="false"
      custom-class="comDialog"
      append-to-body
      width="30%"
      @close="closeCancelDialog"
    >
      <div class="dialogDody">
        <el-form
          ref="cancelForm"
          :model="cancelForm"
          label-width="0px"
          class="dialogForm"
        >
          <el-form-item label="" prop="reason">
            <el-input
              v-model="cancelForm.cancelReason"
              type="textarea"
              :autosize="{ minRows: 5}"
              placeholder="请输入内容"
              size="mini"
              clearable
            />
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="reasonVisible=false">取 消</el-button>
        <el-button
          :loading="addLableLoading"
          :disabled="addLableLoading"
          element-loading-spinner="el-icon-loading"
          type="primary"
          size="mini"
          @click="saveReason"
        >保存</el-button>
      </div>
    </el-dialog>
    <!-- 停工原因   -->
    <el-dialog
      :title="'原因'"
      :visible.sync="stopVisible"
      :close-on-click-modal="false"
      custom-class="comDialog"
      append-to-body
      width="30%"
      @close="closeStopDialog"
    >
      <div class="dialogDody">
        <el-form
          ref="cancelForm"
          :model="cancelForm"
          label-width="0px"
          class="dialogForm"
        >
          <el-form-item label="" prop="reason">
            <el-input
              v-model="cancelForm.stopWorkReason"
              type="textarea"
              :autosize="{ minRows: 5}"
              placeholder="请输入内容"
              size="mini"
              clearable
            />
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="stopVisible=false">取 消</el-button>
        <el-button
          :loading="addLableLoading"
          :disabled="addLableLoading"
          element-loading-spinner="el-icon-loading"
          type="primary"
          size="mini"
          @click="saveStop"
        >保存</el-button>
      </div>
    </el-dialog>
    <!-- 完成机台作业   -->
    <el-dialog
      :title="Matitle"
      :visible.sync="showAddDialog"
      :close-on-click-modal="false"
      custom-class="bodyNoPadDialog bigDialog bigDialogh85"
      width="85%"
    >
      <div class="dialogDody">
        <div class="subTipBtn">
          <span class="mr15"
            ><span class="mr5">作业单号：</span
            >{{ machiaForm.workTaskNo || "系统自动生成" }}</span
          >
          <span class="mr15"
            ><span class="mr5">创建日期：</span
            >{{
              machiaForm.workBeginTime || dayjs().format("YYYY-MM-DD")
            }}</span
          >
          <span
            ><span class="mr5">创建人员：</span
            >{{
              machiaForm.billCreateBy ? machiaForm.workPersonName : name
            }}</span
          >
        </div>
        <el-form
          ref="machiaForm"
          :model="machiaForm"
          class="dialogForm h100"
          label-width="80px"
        >
          <el-row class="h100">
            <el-col :span="18" class="fleft h100">
              <el-row>
                <el-col :span="8"
                  ><el-form-item label="订单单号" prop="xieYiShuHao">
                    <el-input
                      v-model="machiaForm.xieYiShuHao"
                      size="mini"
                      disabled /></el-form-item
                ></el-col>
                <el-col :span="8"
                  ><el-form-item label="生产单号" prop="produceTaskBillNo">
                    <el-input
                      v-model="machiaForm.produceTaskBillNo"
                      size="mini"
                      disabled /></el-form-item
                ></el-col>
                <el-col :span="8"
                  ><el-form-item label="作业单号" prop="workTaskNo">
                    <el-input
                      v-model="machiaForm.workTaskNo"
                      size="mini"
                      disabled /></el-form-item
                ></el-col>
              </el-row>
              <el-row>
                <el-col :span="8"
                  ><el-form-item label="产品名称" prop="orderProductName">
                    <el-input
                      v-model="machiaForm.orderProductName"
                      size="mini"
                      disabled /></el-form-item
                ></el-col>
                <el-col :span="8"
                  ><el-form-item label="工艺名称" prop="produceCraftName">
                    <el-input
                      v-model="machiaForm.produceCraftName"
                      size="mini"
                      disabled
                    /> </el-form-item
                ></el-col>
                <el-col :span="8"
                  ><el-form-item label="操作人员" prop="workPersonName">
                    <el-input
                      v-model="machiaForm.workPersonName"
                      size="mini"
                      disabled
                    /> </el-form-item
                ></el-col>
              </el-row>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="机台名称" prop="produceMachineName">
                    <el-input
                      v-model="machiaForm.produceMachineName"
                      size="mini"
                      disabled
                    /> </el-form-item
                ></el-col>
                <el-col :span="8">
                  <el-form-item label="生产设备" prop="equipmentCode">
                    <!-- <el-input
                      v-model="machiaForm.equipmentName"
                      size="mini"
                      :disabled="canDisablle"
                    />  -->
                    <el-select
                        filterable
                      v-model="machiaForm.equipmentCode"
                      size="mini"
                      placeholder="请选择生产设备"
                      :disabled="allcanDisablle || equipment.length<1"
                    >
                      <el-option
                        v-for="item in equipment"
                        :key="item.equipmentNo"
                        :label="item.equipmentName"
                        :value="item.equipmentNo"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="副手人员" prop="assistantList">
                    <div class="flex permain">
                      <div class="input">
                        <span
                          v-for="(v, p) in assisList"
                          :key="v.employeeCode"
                          class="pointer"
                          @click="deletrPer(p)"
                        >
                          {{ v.employeeName }}<i class="el-icon-close" />
                        </span>
                      </div>
                      <el-button
                        class="bgc57"
                        size="mini"
                        icon="el-icon-user"
                      />
                    </div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item label="作业备注" prop="workTaskRemark">
                    <el-input
                      v-model="machiaForm.workTaskRemark"
                      type="textarea"
                      :rows="3"
                      size="mini"
                      :disabled="allcanDisablle"
                    /> </el-form-item
                ></el-col>
              </el-row>
              <template v-if="type == '印刷'">
                <el-row>
                  <div class="cTitle">
                    <h3>作业信息</h3>
                  </div>
                  <el-col :span="8"
                    ><el-form-item label="计划米数" prop="planMeters">
                      <el-input
                        v-model="machiaForm.planMeters"
                        disabled
                        size="mini"
                      >
                        <template slot="append">米</template></el-input
                      >
                    </el-form-item></el-col
                  >

                  <el-col :span="8"
                    ><el-form-item label="生产米数" prop="produceMeters">
                      <el-input
                        v-model="machiaForm.produceMeters"
                        onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                        size="mini"
                        :disabled="allcanDisablle"
                      >
                        <template slot="append">米</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="完成卷数" prop="finishedRollCount">
                      <el-input
                        v-model="machiaForm.finishedRollCount"
                        onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                        size="mini"
                        :disabled="allcanDisablle"
                        @blur="productMeter"
                      >
                        <template slot="append">卷</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>
                <div class="cTitle">
                  <h3>主料明细</h3>
                </div>
                <el-table
                  :data="machiaForm.mainMaterialDataList"
                  border
                  style="width: 100%"
                >
                  <el-table-column prop="stockGoodsCode" label="物料编号">
                  </el-table-column>
                  <el-table-column prop="goodsName" label="物料名称">
                  </el-table-column>
                  <el-table-column prop="stockGoodsName" label="规格型号">
                  </el-table-column>
                  <el-table-column prop="planUseQuantity" label="计划用料">
                  </el-table-column>
                  <el-table-column prop="printUseQuantity" label="打印用料">
                  </el-table-column>
                  <el-table-column prop="produceGetQuantity" label="领料数量">
                  </el-table-column>
                  <el-table-column prop="replenishQuantity" label="补料数量">
                  </el-table-column>
                  <el-table-column prop="usedSumQuantity" label="已使用数量">
                  </el-table-column>
                  <el-table-column prop="goodsUnitName" label="单位">
                  </el-table-column>
                  <el-table-column prop="usedQuantity" label="使用数量">
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.usedQuantity"
                        placeholder="请输入"
                        size="mini"
                        type="number"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>
                <div class="cTitle">
                  <h3>辅料明细</h3>
                  <div class="operations" v-if="!allcanDisablle">
                    <span @click="showMateria = true"
                      ><i class="el-icon-circle-plus-outline"></i>选择物料</span
                    >|<span @click="handleDeleteMaterial"
                      ><i class="el-icon-delete"></i>删除</span
                    >
                  </div>
                </div>
                <el-table
                  :data="machiaForm.ingredientsDataList"
                  @selection-change="handleMaterialChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column prop="stockGoodsCode" label="物料编号">
                  </el-table-column>
                  <el-table-column prop="goodsName" label="物料名称">
                  </el-table-column>
                  <el-table-column prop="goodsUnitName" label="单位">
                  </el-table-column>
                  <el-table-column prop="usedQuantity" label="使用数量">
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.usedQuantity"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>
                <div class="cTitle">
                  <h3>异常明细</h3>
                  <div class="operations" v-if="!allcanDisablle">
                    <span @click="addExecp"
                      ><i class="el-icon-circle-plus-outline"></i>添加明细</span
                    >|<span @click="handleDeleteAbnormal"
                      ><i class="el-icon-delete"></i>删除</span
                    >
                  </div>
                </div>

                <el-table
                  :data="machiaForm.exceptionDataList"
                  @selection-change="handleAbnormalChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column
                    label="卷号"
                    prop="reelNumber"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.reelNumber"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="开始页码"
                    prop="beginPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.beginPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="结束页码"
                    prop="endPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.endPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="异常原因"
                    prop="exceptionReason"
                    show-overflow-tooltip
                    width="230"
                  >
                    <template slot-scope="{ row }">
                      <el-select
                        filterable
                        v-model="row.exceptionReason"
                        placeholder="请选择"
                        size="mini"
                        filterable
                        :disabled="allcanDisablle"
                      >
                        <el-option
                          v-for="item in reasonDataList"
                          :key="item.exceptionCode"
                          :label="item.exceptionName"
                          :value="item.exceptionCode"
                        />
                      </el-select>
                    </template>
                  </el-table-column>

                  <el-table-column
                    label="备注"
                    show-overflow-tooltip
                    min-width="150"
                    prop="exceptionRemark"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.exceptionRemark"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>
              </template>

              <!-- 制版 -->
              <!-- <el-row>
              <div class="cTitle">
                <h3>申请信息</h3>
              </div>
                <el-col :span="8"
                  ><el-form-item label="申请单号" prop="productMeter">
                    <el-input
                      v-model="machiaForm.productMeters"
                      disabled
                      size="mini"
                    >
                     </el-input
                    >
                  </el-form-item></el-col
                >

                <el-col :span="8"
                  ><el-form-item label="版数" prop="finishedMeters">
                    <el-input
                      v-model="machiaForm.produceMeters"
                      onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                      size="mini"
                      :disabled="allcanDisablle"
                    >
                    </el-input
                    >
                  </el-form-item></el-col
                >
                <el-col :span="8"
                  ><el-form-item label="版面" prop="finishedRollCount">
                    <el-input
                      v-model="machiaForm.finishedRollCount"
                      onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                      size="mini"
                      :disabled="allcanDisablle"
                    >
                    </el-input
                    >
                  </el-form-item></el-col
                >
              </el-row>
              <el-row>
                <el-col :span="8"
                  ><el-form-item label="申请机台" prop="finishedMeters">
                    <el-input
                      v-model="machiaForm.produceMeters"
                      onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                      size="mini"
                      :disabled="allcanDisablle"
                    >
                    </el-input
                    >
                  </el-form-item></el-col
                >
                <el-col :span="8"
                  ><el-form-item label="申请人员" prop="finishedMeters">
                    <el-input
                      v-model="machiaForm.produceMeters"
                      onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                      size="mini"
                      :disabled="allcanDisablle"
                    >
                    </el-input
                    >
                  </el-form-item></el-col
                >
              </el-row>
              <div class="cTitle">
                <h3>作业信息</h3>
              </div>
              <el-row>
                <el-col :span="8"
                  ><el-form-item label="刀版编号" prop="productMeter">
                    <el-input
                      v-model="machiaForm.productMeters"
                      size="mini"
                      placeholder="请填写刀版编号"
                      :disabled="allcanDisablle"
                    >
                     </el-input
                    >
                  </el-form-item></el-col
                >

                <el-col :span="8"
                  ><el-form-item label="刀版名称" prop="finishedMeters">
                    <el-input
                      v-model="machiaForm.produceMeters"
                      onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                      size="mini"
                      placeholder="请填写刀版名称"
                      :disabled="allcanDisablle"
                    >
                    </el-input
                    >
                  </el-form-item></el-col
                >
                <el-col :span="8"
                  ><el-form-item label="刀版尺寸" prop="finishedRollCount">
                    <el-input
                      v-model="machiaForm.finishedRollCount"
                      onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                      size="mini"
                      placeholder="请填写刀版尺寸"
                      :disabled="allcanDisablle"
                    >
                      <template slot="append">mm</template></el-input
                    >
                  </el-form-item></el-col
                >
              </el-row>
              <el-row>
                <el-col :span="8"
                  ><el-form-item label="模数" prop="productMeter">
                    <el-input
                      v-model="machiaForm.productMeters"
                      disabled
                      size="mini"
                      placeholder="请填写模数"
                    >
                     </el-input
                    >
                  </el-form-item></el-col
                >

                <el-col :span="8"
                  ><el-form-item label="刀版费用" prop="finishedMeters">
                    <el-input
                      v-model="machiaForm.produceMeters"
                      onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                      size="mini"
                      placeholder="请填写刀版费用"
                      :disabled="allcanDisablle"
                    >
                    </el-input
                    >
                  </el-form-item></el-col
                >
                <el-col :span="8"
                  ><el-form-item label="存放位置" prop="finishedRollCount">
                    <el-input
                      v-model="machiaForm.finishedRollCount"
                      onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                      size="mini"
                      placeholder="请填写存放位置"
                      :disabled="allcanDisablle"
                    >
                    </el-input
                    >
                  </el-form-item></el-col
                >
              </el-row>
              <el-row>
                <el-col :span="24"
                  ><el-form-item label="制版尺寸" prop="productMeter">
                    <el-input
                      v-model="machiaForm.productMeters"
                      size="mini"
                      :disabled="allcanDisablle"
                      placeholder="尺寸多个用逗号分开，如(小标，中标，大标)"
                    >
                     </el-input
                    >
                  </el-form-item></el-col
                >
              </el-row>
              <el-row>
                <el-col :span="24"
                  ><el-form-item label="刀版备注" prop="productMeter">
                    <el-input
                      v-model="machiaForm.productMeters"
                      size="mini"
                      type="textarea"
                      :disabled="allcanDisablle"
                      :rows="3"
                      placeholder="请填写刀版备注"
                    >
                     </el-input
                    >
                  </el-form-item></el-col
                >
              </el-row> -->

              <template v-if="type == '丝网'">
                <div class="cTitle">
                  <h3>作业明细</h3>
                </div>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="完成卷数" prop="finishedRollCount">
                      <el-input
                        v-model="machiaForm.finishedRollCount"
                        placeholder="请填写完成卷数"
                        :disabled="allcanDisablle"
                        size="mini"
                      >
                        <template slot="append">卷</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="印面" prop="printFace">
                      <el-input
                        v-model="machiaForm.printFace"
                        placeholder="请填写印面"
                        :disabled="allcanDisablle"
                        size="mini"
                        @blur="calculation"
                      >
                        <template slot="append">mm</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="次数" prop="printCount">
                      <el-input
                        v-model="machiaForm.printCount"
                        placeholder="请填写次数"
                        :disabled="allcanDisablle"
                        @blur="calculation"
                        size="mini"
                      >
                        <template slot="append">次</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="成品米数" prop="sW_ProductMeters">
                      <el-input
                        v-model="machiaForm.sW_ProductMeters"
                        placeholder="请填写次数"
                        disabled
                        size="mini"
                      >
                        <template slot="append">米</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>
                <div class="cTitle">
                  <h3>辅料明细</h3>
                  <div class="operations" v-if="!allcanDisablle">
                    <span @click="showMateria = true"
                      ><i class="el-icon-circle-plus-outline"></i>选择物料</span
                    >|<span @click="handleDeleteMaterial"
                      ><i class="el-icon-delete"></i>删除</span
                    >
                  </div>
                </div>
                <el-table
                  :data="machiaForm.ingredientsDataList"
                  @selection-change="handleMaterialChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column prop="goodsCode" label="物料编号">
                  </el-table-column>
                  <el-table-column prop="goodsName" label="物料名称">
                  </el-table-column>
                  <el-table-column prop="stockGoodsName" label="规格型号">
                  </el-table-column>
                  <el-table-column prop="goodsUnitName" label="单位">
                  </el-table-column>
                  <el-table-column prop="usedQuantity" label="使用数量">
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.usedQuantity"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>

                <div class="cTitle">
                  <h3>异常明细</h3>
                  <div class="operations" v-if="!allcanDisablle">
                    <span @click="addExecp"
                      ><i class="el-icon-circle-plus-outline"></i>添加明细</span
                    >|<span @click="handleDeleteAbnormal"
                      ><i class="el-icon-delete"></i>删除</span
                    >
                  </div>
                </div>

                <el-table
                  :data="machiaForm.exceptionDataList"
                  @selection-change="handleAbnormalChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column
                    label="卷号"
                    prop="reelNumber"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.reelNumber"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="开始页码"
                    prop="beginPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.beginPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="结束页码"
                    prop="endPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.endPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="异常原因"
                    prop="exceptionReason"
                    show-overflow-tooltip
                    width="230"
                  >
                    <template slot-scope="{ row }">
                      <el-select
                        filterable
                        v-model="row.exceptionReason"
                        placeholder="请选择"
                        size="mini"
                        filterable
                        :disabled="allcanDisablle"
                      >
                        <el-option
                          v-for="item in reasonDataList"
                          :key="item.exceptionCode"
                          :label="item.exceptionName"
                          :value="item.exceptionCode"
                        />
                      </el-select>
                    </template>
                  </el-table-column>

                  <el-table-column
                    label="备注"
                    show-overflow-tooltip
                    min-width="150"
                    prop="exceptionRemark"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.exceptionRemark"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>
              </template>

              <template v-if="type == '模切'">
                <div class="cTitle">
                  <h3>作业明细</h3>
                </div>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="完成卷数" prop="finishedRollCount">
                      <el-input
                        v-model="machiaForm.finishedRollCount"
                        placeholder="请填写完成卷数"
                        :disabled="allcanDisablle"
                        size="mini"
                      >
                        <template slot="append">卷</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="刀版尺寸" prop="knifeVersionSize">
                      <el-input
                        v-model="machiaForm.knifeVersionSize"
                        placeholder="请填写刀版尺寸"
                        :disabled="allcanDisablle"
                        size="mini"
                        @blur="calculation"
                      >
                        <template slot="append">mm</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="模切次数" prop="cutCount">
                      <el-input
                        v-model="machiaForm.cutCount"
                        placeholder="请填写模切次数"
                        :disabled="allcanDisablle"
                        @blur="calculation"
                        size="mini"
                      >
                        <template slot="append">次</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="成品米数" prop="mQ_ProductMeters">
                      <el-input
                        v-model="machiaForm.mQ_ProductMeters"
                        placeholder="请填写次数"
                        disabled
                        size="mini"
                      >
                        <template slot="append">米</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>

                <div class="cTitle">
                  <h3>异常明细</h3>
                  <div class="operations" v-if="!allcanDisablle">
                    <span @click="addExecp"
                      ><i class="el-icon-circle-plus-outline"></i>添加明细</span
                    >|<span @click="handleDeleteAbnormal"
                      ><i class="el-icon-delete"></i>删除</span
                    >
                  </div>
                </div>

                <el-table
                  :data="machiaForm.exceptionDataList"
                  @selection-change="handleAbnormalChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column
                    label="卷号"
                    prop="reelNumber"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.reelNumber"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="开始页码"
                    prop="beginPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.beginPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="结束页码"
                    prop="endPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.endPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="异常原因"
                    prop="exceptionReason"
                    show-overflow-tooltip
                    width="230"
                  >
                    <template slot-scope="{ row }">
                      <el-select
                        filterable
                        v-model="row.exceptionReason"
                        placeholder="请选择"
                        size="mini"
                        filterable
                        :disabled="allcanDisablle"
                      >
                        <el-option
                          v-for="item in reasonDataList"
                          :key="item.exceptionCode"
                          :label="item.exceptionName"
                          :value="item.exceptionCode"
                        />
                      </el-select>
                    </template>
                  </el-table-column>

                  <el-table-column
                    label="备注"
                    show-overflow-tooltip
                    min-width="150"
                    prop="exceptionRemark"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.exceptionRemark"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>
              </template>
              <template v-if="type == '数码'">
                <div class="cTitle">
                  <h3>作业明细</h3>
                </div>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="完成卷数" prop="finishedRollCount">
                      <el-input
                        v-model="machiaForm.finishedRollCount"
                        placeholder="请填写完成卷数"
                        :disabled="allcanDisablle"
                        size="mini"
                      >
                        <template slot="append">卷</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="打印页数" prop="printPageCount">
                      <el-input
                        v-model="machiaForm.printPageCount"
                        placeholder="请填写打印页数"
                        :disabled="allcanDisablle"
                        size="mini"
                        @blur="calculation"
                      >
                        <template slot="append">页</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="页面大小" prop="printPageSize">
                      <el-input
                        v-model="machiaForm.printPageSize"
                        placeholder="请填写页面大小"
                        :disabled="allcanDisablle"
                        @blur="calculation"
                        size="mini"
                      >
                        <template slot="append">mm</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="成品米数" prop="sM_ProductMeters">
                      <el-input
                        v-model="machiaForm.sM_ProductMeters"
                        placeholder="请填写次数"
                        disabled
                        size="mini"
                      >
                        <template slot="append">米</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>

                <div class="cTitle">
                  <h3>页码明细</h3>
                </div>
                <el-table
                  :data="machiaForm.pageDetailDataList"
                  @selection-change="handlePageChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column
                    label="卷号"
                    prop="reelNumber"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.reelNumber"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="文件名称"
                    prop="pageFileName"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.pageFileName"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="总页数"
                    prop="totalPageCount"
                    show-overflow-tooltip
                    width="100"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.totalPageCount"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="起始号"
                    prop="beginNo"
                    show-overflow-tooltip
                    width="120"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.beginNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="截止号"
                    prop="endNo"
                    show-overflow-tooltip
                    width="120"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.endNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>

                  <el-table-column
                    label="备注"
                    show-overflow-tooltip
                    min-width="150"
                    prop="remark"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.remark"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>

                <div class="cTitle">
                  <h3>异常明细</h3>
                  <div class="operations" v-if="!allcanDisablle">
                    <span @click="addExecp"
                      ><i class="el-icon-circle-plus-outline"></i>添加明细</span
                    >|<span @click="handleDeleteAbnormal"
                      ><i class="el-icon-delete"></i>删除</span
                    >
                  </div>
                </div>

                <el-table
                  :data="machiaForm.exceptionDataList"
                  @selection-change="handleAbnormalChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column
                    label="卷号"
                    prop="reelNumber"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.reelNumber"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="开始页码"
                    prop="beginPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.beginPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="结束页码"
                    prop="endPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.endPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="异常原因"
                    prop="exceptionReason"
                    show-overflow-tooltip
                    width="230"
                  >
                    <template slot-scope="{ row }">
                      <el-select
                        filterable
                        v-model="row.exceptionReason"
                        placeholder="请选择"
                        size="mini"
                        filterable
                        :disabled="allcanDisablle"
                      >
                        <el-option
                          v-for="item in reasonDataList"
                          :key="item.exceptionCode"
                          :label="item.exceptionName"
                          :value="item.exceptionCode"
                        />
                      </el-select>
                    </template>
                  </el-table-column>

                  <el-table-column
                    label="备注"
                    show-overflow-tooltip
                    min-width="150"
                    prop="exceptionRemark"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.exceptionRemark"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>
              </template>
              <template v-if="type == '采集'">
                <div class="cTitle">
                  <h3>作业明细</h3>
                </div>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="完成卷数" prop="finishedRollCount">
                      <el-input
                        v-model="machiaForm.finishedRollCount"
                        placeholder="请填写完成卷数"
                        :disabled="allcanDisablle"
                        size="mini"
                      >
                        <template slot="append">卷</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="每卷数量" prop="everyRollQuantity">
                      <el-input
                        v-model="machiaForm.everyRollQuantity"
                        placeholder="请填写每卷数量"
                        :disabled="allcanDisablle"
                        size="mini"
                        @blur="calculation"
                      >
                        <template slot="append">{{ machiaForm.orderProductUnit }}</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="成品数量" prop="productQuantity">
                      <el-input
                        v-model="machiaForm.productQuantity"
                        placeholder="请填写成品数量"
                        :disabled="allcanDisablle"
                        @blur="calculation"
                        size="mini"
                      >
                        <template slot="append">{{ machiaForm.orderProductUnit }}</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>
                <div class="cTitle">
                  <h3>异常明细</h3>
                  <div class="operations" v-if="!allcanDisablle">
                    <span @click="addExecp"
                      ><i class="el-icon-circle-plus-outline"></i>添加明细</span
                    >|<span @click="handleDeleteAbnormal"
                      ><i class="el-icon-delete"></i>删除</span
                    >
                  </div>
                </div>

                <el-table
                  :data="machiaForm.exceptionDataList"
                  @selection-change="handleAbnormalChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column
                    label="卷号"
                    prop="reelNumber"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.reelNumber"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="开始页码"
                    prop="beginPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.beginPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="结束页码"
                    prop="endPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.endPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="异常原因"
                    prop="exceptionReason"
                    show-overflow-tooltip
                    width="230"
                  >
                    <template slot-scope="{ row }">
                      <el-select
                        filterable
                        v-model="row.exceptionReason"
                        placeholder="请选择"
                        size="mini"
                        filterable
                        :disabled="allcanDisablle"
                      >
                        <el-option
                          v-for="item in reasonDataList"
                          :key="item.exceptionCode"
                          :label="item.exceptionName"
                          :value="item.exceptionCode"
                        />
                      </el-select>
                    </template>
                  </el-table-column>

                  <el-table-column
                    label="备注"
                    show-overflow-tooltip
                    min-width="150"
                    prop="exceptionRemark"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.exceptionRemark"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>
              </template>
              <template v-if="type == '检验'">
                <div class="cTitle">
                  <h3>作业明细</h3>
                </div>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="完成卷数" prop="finishedRollCount">
                      <el-input
                        v-model="machiaForm.finishedRollCount"
                        placeholder="请填写完成卷数"
                        :disabled="allcanDisablle"
                        size="mini"
                      >
                        <template slot="append">卷</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="检验米数" prop="inspectMeters">
                      <el-input
                        v-model="machiaForm.inspectMeters"
                        placeholder="请填写检验米数"
                        :disabled="allcanDisablle"
                        size="mini"
                      >
                        <template slot="append">{{ machiaForm.orderProductUnit }}</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="检验数量" prop="inspectCount">
                      <el-input
                        v-model="machiaForm.inspectCount"
                        placeholder="请填写检验数量"
                        :disabled="allcanDisablle"
                        @blur="calculation"
                        size="mini"
                      >
                        <template slot="append">{{ machiaForm.orderProductUnit }}</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>
                <el-row>
                  <el-col :span="8"
                    ><el-form-item label="不良成品" prop="noPassCount">
                      <el-input
                        v-model="machiaForm.noPassCount"
                        placeholder="请填写不良成品"
                        :disabled="allcanDisablle"
                        @blur="calculation"
                        size="mini"
                      >
                        <template slot="append">套</template></el-input
                      >
                    </el-form-item></el-col
                  >
                  <el-col :span="8"
                    ><el-form-item label="不合格率" prop="productQuantity">
                      <el-input
                        v-model="machiaForm.percentDefective"
                        placeholder="自动计算"
                        disabled
                        size="mini"
                      >
                        <template slot="append">%</template></el-input
                      >
                    </el-form-item></el-col
                  >
                </el-row>
                <div class="cTitle">
                  <h3>异常明细</h3>
                  <div class="operations" v-if="!allcanDisablle">
                    <span @click="addExecp"
                      ><i class="el-icon-circle-plus-outline"></i>添加明细</span
                    >|<span @click="handleDeleteAbnormal"
                      ><i class="el-icon-delete"></i>删除</span
                    >
                  </div>
                </div>

                <el-table
                  :data="machiaForm.exceptionDataList"
                  @selection-change="handleAbnormalChange"
                  border
                  style="width: 100%"
                >
                  <el-table-column type="selection" width="55">
                  </el-table-column>
                  <el-table-column
                    label="卷号"
                    prop="reelNumber"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.reelNumber"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="开始页码"
                    prop="beginPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.beginPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="结束页码"
                    prop="endPageNo"
                    show-overflow-tooltip
                    width="190"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.endPageNo"
                        placeholder="请输入"
                        type="number"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="异常原因"
                    prop="exceptionReason"
                    show-overflow-tooltip
                    width="230"
                  >
                    <template slot-scope="{ row }">
                      <el-select
                        filterable
                        v-model="row.exceptionReason"
                        placeholder="请选择"
                        size="mini"
                        filterable
                        :disabled="allcanDisablle"
                      >
                        <el-option
                          v-for="item in reasonDataList"
                          :key="item.exceptionCode"
                          :label="item.exceptionName"
                          :value="item.exceptionCode"
                        />
                      </el-select>
                    </template>
                  </el-table-column>

                  <el-table-column
                    label="备注"
                    show-overflow-tooltip
                    min-width="150"
                    prop="exceptionRemark"
                  >
                    <template slot-scope="{ row }">
                      <el-input
                        v-model="row.exceptionRemark"
                        placeholder="请输入"
                        size="mini"
                        :disabled="allcanDisablle"
                      />
                    </template>
                  </el-table-column>
                </el-table>
              </template>
            </el-col>
            <el-col :span="6" class="formItem fright">
              <el-form-item label="上班班次" prop="indexNumber">
                <el-select
                        filterable
                  v-model="machiaForm.workShiftNo"
                  :disabled="allcanDisablle"
                  placeholder="请选择"
                  size="mini"
                  filterable
                >
                  <el-option
                    v-for="item in bcList"
                    :key="item.code"
                    :label="item.name"
                    :value="item.code"
                  />
                </el-select>
              </el-form-item>
              <el-form-item label="开始时间">
                <el-date-picker
                  v-model="machiaForm.workBeginTime"
                  type="datetime"
                  :picker-options="option"
                  placeholder="选择日期"
                  size="mini"
                  disabled
                />
              </el-form-item>
              <el-form-item label="结束时间">
                <el-date-picker
                  v-model="machiaForm.workFinishTime"
                  type="datetime"
                  :picker-options="option"
                  placeholder="选择日期"
                  size="mini"
                  disabled
                />
              </el-form-item>
              <el-form-item label="产品耗时">
                <el-input
                  v-model="machiaForm.taskUseTime"
                  onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                  placeholder="0"
                  size="mini"
                  disabled
                >
                  <template slot="append">分钟</template></el-input
                >
              </el-form-item>
              <el-form-item label="其他时间">
                <el-input
                  v-model="machiaForm.otherUseTime"
                  onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                  placeholder="0"
                  size="mini"
                  disabled
                >
                  <template slot="append">分钟</template></el-input
                >
              </el-form-item>
              <el-form-item label="计划工时">
                <el-input
                  v-model="machiaForm.planWorkTime"
                  onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                  placeholder="0"
                  size="mini"
                  disabled
                >
                  <template slot="append">分钟</template></el-input
                >
              </el-form-item>

              <el-form-item label="标准效率">
                <el-input
                  v-model="machiaForm.standardEfficiency"
                  onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                  placeholder="0"
                  size="mini"
                  disabled
                >
                  <template slot="append">米/小时</template></el-input
                >
              </el-form-item>
              <el-form-item label="生产工时">
                <el-input
                  v-model="machiaForm.actualWorkTime"
                  onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                  placeholder="0"
                  size="mini"
                  disabled
                >
                  <template slot="append">分钟</template></el-input
                >
              </el-form-item>
              <el-form-item label="工作效率">
                <el-input
                  v-model="machiaForm.workEfficiency"
                  onkeyup="this.value = this.value.replace(/[^\d.]/g,'');"
                  placeholder="0"
                  size="mini"
                  disabled
                >
                  <template slot="append">米/小时</template></el-input
                >
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="showAddDialog = false">取 消</el-button>
        <!-- 新增       -->
        <el-button
          v-if="opsid !== -1"
          :loading="addLoading"
          :disabled="addLoading"
          element-loading-spinner="el-icon-loading"
          type="primary"
          size="mini"
          @click="saveMachina"
        >
          {{ opsid === 0 ? "完成" : "保存" }}</el-button
        >
      </div>
    </el-dialog>
    <!-- 人员寻找弹框   -->
    <per-redio-dialog
      :per-visible.sync="isperShow"
      @getEmployee="getEmployee"
    />
  </div>
</template>
<script>
import { arraySort } from '@/utils'
import HeadSeting from '@/components/HeadSeting'
import Pagination from '@/components/Pagination'
import selectProductOrder from '@/components/selectProductOrder'
import perRedioDialog from '@/components/perDialogRedio'
import { mapGetters } from 'vuex'
import { parseTime } from '@/utils'
import screec from "@/components/screen";

export default {
  name: 'inspectionMachineList',
  components: { Pagination, HeadSeting, selectProductOrder, perRedioDialog,screec },
  data() {
    return {
      opsid: 0,
      productPlan: '0', // 1 任务看板 2 生产明细
      planStatus: ['待开始', '生产中', '待停工'],
      option: {
        disabledDate: (time) => {
          return time.getTime() < Date.now() - 1 * 24 * 3600 * 1000
        }
      },
      showOrder: false,
      isperShow: false,
      addLoading: false,
      productPlanList: [[], [], []],
      productTableList: [],
      bcList: [],
      assisList: [],
      Matitle: '',
      allcanDisablle: false,
      showAddDialog: false,
      canDisablle: false,
      machiaForm: {
        scrapMeters: 0,
        finishedMeters: 0,
        productMeters: 0,
        exceptionDataList: []
      },
      tableHeight: null, // 表格最大高度
      isSeeMaterriel: false, // 查看弹框是否打开
      isAddMaterriel: false, // 新建弹框是否打开
      addMaterrielLoading: false, // 新建保存加载
      searchLoading: false, // 搜索加载效果
      allMaterirls: [], // 全部数据列表
      isDisable: null,
      addLableLoading: false,
      reasonVisible: false, //  报废
      stopVisible: false, // 停工
      devicesCodes: [],
      currentItem: null,
      ExceptionTypeList: [],
      // 表格操作
      materForm: {
        indexNumber: 1000
      },
      cancelForm: {
        cancelReason: '',
        stopWorkReason: ''
      },
      equipmentNo: '',
      equipment: "",
      reasonDataList: [],
      materiaChecked: [], //辅料明细选中数据
      abnormalChecked: [], //异常明细选中数据
      pageChecked: [], //页码明细选中数据
      searchP: {
        pageIndex: 1,
        pageSize: 30,
        likeWords: '',
        customerCode: '',
        orderType: 0,
        queryCondition: 0,
        orderState: -1,
        produceState: -1,
        financeState: -1,
        deliveryState: -1
      }, // 销售订单搜索条件
      // 搜索条件
      search: {
        QueryDataBaseFiled:'',
        pageIndex: 1,
        pageSize: 30,
        likeWords: '',
        equipmentNo: ''
      },
      total: 0, // 总条数
      tableHead: [], // 表格表头
      type:''
    }
  },
  computed: {
    ...mapGetters(['name'])
  },
  created() {
    //  所有列表数据
    this.equipmentNo = this.$route.query.equipmentNo ? this.$route.query.equipmentNo : ''
    this.search.equipmentNo = this.$route.query.equipmentNo ? this.$route.query.equipmentNo : ''
    this.type = this.$route.query.type
    this.getAllMaterils()
    // 表格得表头
    this.getTableHead()
    this.getBC()
    this.getWorkExceptionTypeDataList()
    this.getpanlist()
    this.productTableList = this.productPlanList.flat()
  },

  mounted() {
    // 表格高度
    this.calHeight()
  },
  updated() {
    this.$nextTick(() => {
      this.$refs.multipleTable.doLayout()
    })
  },
  methods: {
    getClass(item) {
      if (item.deliveryBalanceDays <= 1) {
        return 'orgen'
      }
      if (item.deliveryBalanceDays < 0) {
        return 'dred'
      }
    },
    // 得到业务开单所有数据列表
    getpanlist() {
      this.$api.business.GetWaitStopWorkProduceTasksForEquipment({
        equipmentNo: this.equipmentNo
      }).then(res => {
        res.forEach(e => {
          this.productPlanList[2].push(e)
        })
      }).catch(() => {
      })
      this.$api.business.GetInProduceProduceTasksForEquipment({
        equipmentNo: this.equipmentNo
      }).then(res => {
        res.forEach(e => {
          this.productPlanList[1].push(e)
        })
      }).catch(() => {
      })
      this.$api.business.GetWaitDoProduceTasksForEquipment({
        equipmentNo: this.equipmentNo
      }).then(res => {
        res.forEach(e => {
          this.productPlanList[0].push(e)
        })
      }).catch(() => {
      })
    },
    toOrdereInfo(e) {
      this.$router.push({
        path: '/production/machineTask', // 跳转的路径
        query: {
          orderID: e.saleOrderID,
          saleOrderNo: e.saleOrderNo,
          produceTaskBillNo: e.produceTaskBillNo,
          equipmentNo: this.equipmentNo,
          type:this.type
        }
      })
    },
    changePlan(val) {
      this.productPlan = val
      this.calHeight()
    },

    //添加页码明细
    handleAddPage() {
      this.machiaForm.pageDetailDataList.push({
        index: this.indexPage,
        pageFileName: "",
        totalPageCount: 0,
        beginNo: 0,
        endNo: 0,
        remark: "",
      });
      this.indexPage++;
    },

     //删除页码明细
    handleDeletePage() {
      if (this.pageChecked.length < 1) {
        this.$message.warning("请选择要删除的明细");
      } else {
        this.pageChecked.forEach((j) => {
          if (j.recordID) {
            this.machiaForm.pageDetailDataList =
              this.machiaForm.pageDetailDataList.filter((e) => {
                return e.recordID != j.recordID;
              });
          } else {
            this.machiaForm.pageDetailDataList =
              this.machiaForm.pageDetailDataList.filter((e) => {
                return e.index != j.index;
              });
          }
        });
        this.$forceUpdate();
      }
    },

    //页码明细选择事件
    handlePageChange(e) {
      this.pageChecked = e;
    },

    //异常明细选中事件
    handleAbnormalChange(e) {
      this.abnormalChecked = e;
    },

    //删除异常明细
    handleDeleteAbnormal() {
      if (this.abnormalChecked.length < 1) {
        this.$message.warning("请选择要删除的明细");
      } else {
        this.abnormalChecked.forEach((j) => {
          if (j.exceptionID) {
            this.machiaForm.exceptionDataList =
              this.machiaForm.exceptionDataList.filter((e) => {
                return e.exceptionID != j.exceptionID;
              });
          } else {
            this.machiaForm.exceptionDataList =
              this.machiaForm.exceptionDataList.filter((e) => {
                return e.index != j.index;
              });
          }
        });
        this.$forceUpdate();
      }
    },

    //计算成品米数
    calculation() {
      if (this.type == "丝网") {
        if (this.machiaForm.printFace && this.machiaForm.printCount) {
          this.machiaForm.sW_ProductMeters =
            (this.machiaForm.printFace * this.machiaForm.printCount) / 1000;
        } else {
          this.machiaForm.sW_ProductMeters = "";
        }
      } else if (this.type == "模切") {
        if (this.machiaForm.knifeVersionSize && this.machiaForm.cutCount) {
          this.machiaForm.mQ_ProductMeters =
            (this.machiaForm.knifeVersionSize * this.machiaForm.cutCount) /
            1000;
        } else {
          this.machiaForm.mQ_ProductMeters = "";
        }
      } else if (this.type == "数码") {
        if (this.machiaForm.printPageCount && this.machiaForm.printPageSize) {
          this.machiaForm.sM_ProductMeters =
            (this.machiaForm.printPageCount * this.machiaForm.printPageSize) /
            1000;
        } else {
          this.machiaForm.sM_ProductMeters = "";
        }
      } else if (this.type == "检验") {
        if (this.machiaForm.inspectCount && this.machiaForm.noPassCount) {
          this.machiaForm.percentDefective =
            (this.machiaForm.noPassCount/this.machiaForm.inspectCount) * 100;
        } else {
          this.machiaForm.percentDefective = "";
        }
      }
    },
     //辅料明细选择事件
    handleMaterialChange(e) {
      this.materiaChecked = e;
    },

    //删除辅料明细
    handleDeleteMaterial() {
      if (this.materiaChecked.length < 1) {
        this.$message.warning("请选择要删除的辅料");
      } else {
        this.materiaChecked.forEach((j) => {
          this.machiaForm.ingredientsDataList =
            this.machiaForm.ingredientsDataList.filter((e) => {
              return e.stockGoodsID != j.stockGoodsID;
            });
        });
        this.$forceUpdate();
        console.log(this.machiaForm.ingredientsDataList);
      }
    },

     //异常明细选中事件
    handleAbnormalChange(e) {
      this.abnormalChecked = e;
    },

    //删除异常明细
    handleDeleteAbnormal() {
      if (this.abnormalChecked.length < 1) {
        this.$message.warning("请选择要删除的明细");
      } else {
        this.abnormalChecked.forEach((j) => {
          if (j.exceptionID) {
            this.machiaForm.exceptionDataList =
              this.machiaForm.exceptionDataList.filter((e) => {
                return e.exceptionID != j.exceptionID;
              });
          } else {
            this.machiaForm.exceptionDataList =
              this.machiaForm.exceptionDataList.filter((e) => {
                return e.index != j.index;
              });
          }
        });
        this.$forceUpdate();
      }
    },
    // 新建点击事件
    newAddClick() {
    },
    // 得到申请人员
    getEmployee(val) {
      //  this.contractForm.contractSigningPerson = val.employeeCode
      // this.contractForm.contractSigningPersonName = val.employeeName

      if (this.assisList.length === 0) {
        this.assisList.push({
          employeeCode: val.employeeCode,
          employeeName: val.employeeName
        })
      } else {
        const checked = this.assisList.some((item) => {
          if (item.employeeCode === val.employeeCode) {
            return true
          }
        })
        if (!checked) {
          this.assisList.push({
            employeeCode: val.employeeCode,
            employeeName: val.employeeName
          })
        }
      }
    },
    openPer() {
      if (this.allcanDisablle) {
        return
      } else {
        this.isperShow = true
      }
    },
    getWorkExceptionTypeDataList() {
      this.$api.system.GetWorkExceptionTypeDataList({}).then((res) => {
        this.ExceptionTypeList = res
      })
    },
    deleteRow(index) {
      this.machiaForm.exceptionDataList.splice(index, 1)
    },
    addExecp() {
      this.machiaForm.exceptionDataList.push({
        exceptionNumberSegment: '',
        exceptionType: this.ExceptionTypeList[0].exceptionType,
        exceptionReason: ''
      })
    },
    getBC() {
      const _d = {
        isDelete: 0,
        isDisable: 0,
        likeWords: '',
        pageIndex: 1,
        pageSize: 30
      }

      this.$api.system.GetMatchPageProductClasss(_d).then((res) => {
        this.bcList = res.list
      })
    },
    parseTime(time, cFormat) {
      return parseTime(time, cFormat)
    },
    timeFn(d1, d2) {
      if (d1 && d2) {
      // 如果时间格式是正确的，那下面这一步转化时间格式就可以不用了
        const dateBegin = new Date(d1.replace(/-/g, '/'))// 将-转化为/，使用new Date
        const dateEnd = new Date(d2.replace(/-/g, '/'))// 获取当前时间
        const dateDiff = dateEnd.getTime() - dateBegin.getTime()// 时间差的毫秒数
        const leave1 = dateDiff % (24 * 3600 * 1000) // 计算天数后剩余的毫秒数
        // 计算相差分钟数
        const leave2 = leave1 % (3600 * 1000) // 计算小时数后剩余的毫秒数
        const minutes = Math.floor(leave1 / (60 * 1000))// 计算相差分钟数
        return minutes
      }
    },
    productMeter() {
      this.machiaForm.productMeters = Number(this.machiaForm.scrapMeters) + Number(this.machiaForm.finishedMeters)
      this.machiaForm.passCount = Number(this.machiaForm.inspectCount) - Number(this.machiaForm.noPassCount)
      this.machiaForm.percentDefective = Number(this.machiaForm.noPassCount) / Number(this.machiaForm.inspectCount) * 100
    },
    getChangeTime() {
      this.machiaForm.meetingSumTime = Number(this.machiaForm.meetingCount) * 30
      this.machiaForm.printingDownSumTime = Number(this.machiaForm.printingDownCount) * 30
      this.machiaForm.eatUseSumTime = Number(this.machiaForm.eatCount) * 30
      this.machiaForm.actualWorkTime = this.machiaForm.produceUseTime - (this.machiaForm.eatUseSumTime + this.machiaForm.printingDownSumTime +
      this.machiaForm.meetingSumTime + Number(this.machiaForm.maintainTime) + Number(this.machiaForm.standbyTime) +
      Number(this.machiaForm.assistTime) + Number(this.machiaForm.debugMachineTime))
    },

    checkWork(item3) {
      this.opsid = -1
      this.Matitle = '查看生产作业'
      this.canDisablle = true
      this.allcanDisablle = true
      const _data = {
        workTaskID: item3.workTaskID,
        workTaskNo: item3.workTaskNo
      }
      this.$api.product.GetProduceCraftWorkTaskDetail(_data).then((res) => {
        this.equipment = res.equipmentDataList;
        this.assisList	 = res.assistantList
        this.machiaForm = res.baseData
        this.machiaForm.mainMaterialDataList = res.mainMaterialDataList;
        this.machiaForm.ingredientsDataList = res.ingredientsDataList;
        this.machiaForm.pageDetailDataList = res.pageDetailDataList;
        this.reasonDataList = res.exceptionReasonList;
        this.machiaForm.exceptionDataList = res.exceptionDataList
        this.machiaForm.produceUseTime = this.timeFn(this.machiaForm.workBeginTime, this.machiaForm.workFinishTime)
        // this.machiaForm.workShiftNo = 'BC0019'
        this.showAddDialog = true
      })
    },
    print(item3) {
      this.opsid = 2
      this.Matitle = '修改生产作业'
      this.canDisablle = true
      this.allcanDisablle = false
      const _data = {
        workTaskID: item3.workTaskID,
        workTaskNo: item3.workTaskNo
      }
      this.$api.product.GetProduceCraftWorkTaskDetail(_data).then((res) => {
        this.equipment = res.equipmentDataList;
        this.assisList	 = res.assistantList
        this.assisList.forEach(e => {
          e.employeeCode = e.employeeNo
        })
        this.machiaForm = res.baseData
        this.machiaForm.exceptionDataList = res.exceptionDataList
        this.machiaForm.mainMaterialDataList = res.mainMaterialDataList;
        this.machiaForm.ingredientsDataList = res.ingredientsDataList;
        this.machiaForm.pageDetailDataList = res.pageDetailDataList;
        this.machiaForm.produceUseTime = this.timeFn(this.machiaForm.workBeginTime, this.machiaForm.workFinishTime)
        // this.machiaForm.workShiftNo = 'BC0019'
        this.showAddDialog = true
      })
    },
    doneWork(item3) {
      this.opsid = 0
      this.Matitle = '完成生产作业'
      this.canDisablle = true
      this.allcanDisablle = false
      const _data = {
        workTaskID: item3.workTaskID,
        workTaskNo: item3.workTaskNo
      }
      this.$api.product.GetProduceCraftWorkTaskDetail(_data).then((res) => {
        this.assisList	 = res.assistantList
        this.assisList.forEach(e => {
          e.employeeCode = e.employeeNo
        })
        this.machiaForm = res.baseData
        this.machiaForm.exceptionDataList = res.exceptionDataList
        this.machiaForm.workFinishTime = this.parseTime(new Date())// 获取当前时间
        this.machiaForm.produceUseTime = this.timeFn(this.machiaForm.workBeginTime, this.machiaForm.workFinishTime)
        // this.machiaForm.workShiftNo = 'BC0019'
        this.showAddDialog = true
      })
    },

    saveMachina() {
      const _d = []
      this.assisList.forEach(e => {
        _d.push(e.employeeCode)
      })
      this.machiaForm.assistantList = _d
      if (this.opsid === 0) {
        this.$api.product.FinishedProduceCraftWorkTask(this.machiaForm).then((res) => {
          this.$message({
            type: 'success',
            message: '完成成功!'
          })
          this.showAddDialog = false
          this.getAllMaterils()
        })
      } else {
        this.$api.product.UpdateProduceCraftWorkTask(this.machiaForm).then((res) => {
          this.$message({
            type: 'success',
            message: '修改成功!'
          })
          this.showAddDialog = false
          this.getAllMaterils()
        })
      }
    },
    deletrPer(index) {
      if (this.allcanDisablle) {
        return
      } else {
        this.assisList.splice(index, 1)
      }
    },
    stopOne(item3) {
      this.$confirm('是否删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$api.product
          .DeleteProduceCraftWorkTask({
            workTaskID: item3.workTaskID
          })
          .then((res) => {
            this.$message({
              type: 'success',
              message: '删除成功!'
            })
            this.getAllMaterils()
          })
          .catch(() => {
          })
      })
    },
    // 查看
    checkProductList(row) {
      this.toOrdereInfo(row)
      // this.$router.push({
      //   path: '/business/orderDetail', // 跳转的路径
      //   query: {
      //     tabIndex: 3,
      //     saleOrderNo: row.saleOrderNo,
      //     showTOP: true
      //   }
      // })
    },
    closeCancelDialog() {
      this.reasonVisible = false
    },
    closeStopDialog() {
      this.stopVisible = false
    },
    // 停工
    saveStop() {
      this.$api.product
        .StopProduceTaskBill({
          produceTaskID: this.currentItem.produceTaskID,
          cancelReason: this.cancelForm.stopWorkReason
        })
        .then((res) => {
          this.stopVisible = false
          this.getAllMaterils()
        })
        .catch(() => {
        })
    },
    // 报废
    saveReason() {
      this.$api.product
        .CancelProduceTaskBill({
          produceTaskID: this.currentItem.produceTaskID,
          cancelReason: this.cancelForm.cancelReason
        })
        .then((res) => {
          this.reasonVisible = false
          this.getAllMaterils()
        })
        .catch(() => {
        })
    },
    // 查看
    showProduct(row) {
      this.$router.push({
        path: '/business/orderDetail', // 跳转的路径
        query: {
          tabIndex: 3,
          saleOrderNo: row.saleOrderNo
        }
      })
    },
    // 修改
    handleUpdata(row) {
      this.$router.push({
        path: '/production/productionBilling', // 跳转的路径
        query: {
          produceTaskBillNo: row.produceTaskBillNo,
          produceTaskID: row.produceTaskID,
          typeStatus: 2
        }
      })
    },
    // 确定
    handleConfirm(row) {
      this.$router.push({
        path: '/production/productionBilling', // 跳转的路径
        query: {
          produceTaskBillNo: row.produceTaskBillNo,
          produceTaskID: row.produceTaskID,
          typeStatus: 3
        }
      })
    },
    // 补单
    handleFixm(item) {
      this.$router.push({
        path: '/production/productionBilling', // 跳转的路径
        query: {
          produceTaskBillNo: item.produceTaskBillNo,
          typeStatus: 4
        }
      })
    },
    // 完成生产
    handleDone(item) {
      this.$api.product
        .FinishedProduceTaskBill({
          produceTaskID: item.produceTaskID
        })
        .then((res) => {
          this.getAllMaterils()
        })
        .catch(() => {
        })
    },
    // 复制
    handleReCopy(item) {
      this.$router.push({
        path: '/production/productionBilling', // 跳转的路径
        query: {
          produceTaskBillNo: item.produceTaskBillNo,
          produceTaskID: item.produceTaskID,
          saleOrderNo: item.saleOrderNo,
          typeStatus: 5
        }
      })
    },
    // 停工
    handleStop(item) {
      this.currentItem = item
      this.cancelForm.stopWorkReason = ''
      this.stopVisible = true
    },
    selectCurrentRow(row) {
      this.$router.push({
        path: '/business/orderDetail', // 跳转的路径
        query: {
          saleOrderNo: row.orderNo,
          saleOrderID: row.orderID,
          tabIndex: 3,
          showTOP: true
        }
      })
    },
    //  修改设备
    modifyInfo(data) {
      this.materForm = Object.assign(data, {})
    },
    // 设备类型列表
    getProductCraftsFiles() {
      this.$api.system.GetProductDeviceList().then((res) => {
        this.devicesCodes = res
      })
    },
    getAllLists() {
      this.getAllMaterils()
    },
    // 详情
    getMaterielInfo(id) {},
    // 保存表头样式变化
    saveHead(newArray) {
      const parmas = newArray
      setTimeout(() => {
        this.$api.common.saveTableStyle(parmas).then(() => {})
      }, 300)
    },
    // 保存表头列宽度
    surverWidth(newWidth, oldWidth, column) {
      setTimeout(() => {
        const heads = [...this.tableHead]
        heads.forEach(item => {
          if (item.columnCode === column.property) {
            item.columnWidth = column.width
            return
          }
        })
        this.saveHead(heads)
      }, 100)
    },
    // 表格最大高度
    calHeight() {
      this.$nextTick(() => {
        const rect = this.$refs.tableCon.getBoundingClientRect()
        this.tableHeight = rect.height
      })
    },
    // ，清除所有查询条件
    Refresh() {
      this.search = this.$options.data().search
      this.getAllMaterils()
    },
    // 获取表格表头
    getTableHead() {
      const parmas = {
        tableCode: this.$config.produceworktasklist
      }
      this.$api.common.getAllTableHead(parmas).then((res) => {
        res.sort(arraySort('columnSort'))
        this.tableHead = res
      })
    },
    // 所有列表数据
    getAllMaterils() {
      const parmas = this.search
      this.searchLoading = true
      this.$api.product
        .GetPageProduceCraftWorkTasks(parmas)
        .then((res) => {
          this.allMaterirls = res.list
          this.allMaterirls.forEach((item)=>{
            for(let i in item){
              if(!item[i] && item[i] !== 0){
                item[i] = '--'
              }
            }
          })
          this.total = res.totalCount
          this.searchLoading = false
        })
        .catch(() => {
          this.searchLoading = false
        })
    },
    // 新建弹框关闭事件
    closeDialog() {
      if (this.$refs.materForm) {
        this.$refs.materForm.resetFields()
      }
      this.materForm = this.$options.data().materForm
    }
  }
}
</script>
<style lang="scss" scoped>

.lNavt {
  padding-right: 4px;
  background: #f7f8fa;

  .itemCon {
    display: flex;
    margin: 10px;
    padding: 0 5px;
    width: 100%;
  }
}

.colorList {
  margin-top: 10px;

  li {
    border: 1px solid #eeeeef;
    margin-bottom: 10px;

    .fName {
      position: relative;

      &:before {
        content: "";
        position: absolute;
        left: 0;
        height: 22px;
        border-left: 3px solid #3f61f1;
        top: -1px;
      }
    }

    .colorCon {
      line-height: 22px;
      padding: 16px;
    }
  }
}

.newLayeeCon {
  margin-top: 10px;

  .el-button {
    width: 100%;
  }
}

.tabCon {
  width: 100%;
  padding: 0 16px;
  .btnlist {
    display: flex;
    justify-content: end;
    padding: 0 16px;
    margin: 16px;
  }
}

.tagsBox {
  display: flex;
  flex: 1;
  height: 100%;
  width: 100%;

  .tagsRgBox {
    width: 320px;
    flex-shrink: 0;
    height: 100%;
    border-left: 1px solid #e6e6e6;
    background: #fff;
    overflow: auto;

    .tabBox {
      ul {
        li {
          width: 33.3%;
          text-align: center;
          height: 32px;
          line-height: 32px;
          border-right: 1px solid #e6e6e6;
          background: #f7f8faff;
          border-bottom: 1px solid #e6e6e6;
          cursor: pointer;

          &:last-child {
            border-right: none;
          }

          &.on {
            background: #fff;
            border-bottom: 1px solid #fff;
          }
        }
      }
    }
  }
}

.permain {
  // align-items: baseline;
  line-height: 40px;
  height: 40px;

  .input {
    width: 100%;
    height: 28px;
    line-height: 28px;
    border-radius: 4px 0 0 4px;
    border: 1px solid #dcdfe6;

    span {
      display: inline-block;
      font-size: 12px;
      height: 22px;
      line-height: 22px;
      padding: 2px 5px;
      background-color: #f5f6f9;
      margin: 2px 5px;
    }
  }

  .bgc57 {
    height: 28px;
    background-color: #f5f7fa;
    border-radius: 0px 4px 4px 0px;
    margin-left: -1px;
  }
}

.cwapper {
  flex: 1;
  flex-direction: column;
  margin-left: 8px;
  .vss {
    height: 100%;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    overflow: hidden;
  }
}

.infoSCDD {
  background-color: #fff;
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  border: 1px solid #e6e6e6;
  padding: 16px;
  margin-bottom: 8px;
  span {
    margin-right: 20px;
    color: #999aaa;
  }
}

.tableCon {
  border: 1px solid #e6e6e6;
}

.cHeader {
  text-align: start;
  font-weight: 600;
  line-height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid #e6e6e6;
}

.fleft {
  border-right: 1px solid #d8d8d8;
  padding: 16px;
}

.fright {
  padding: 16px;
  .count {
    display: flex;
    align-items: center;
    color: #999aaa;
  }
  .el-form-item:not(:last-child) {
    margin-bottom: 8px;
  }
}

.subTipBtn {
  border-bottom: 1px #e6e6e6 solid;
  background: #f5f6f9;
  padding: 8px 16px;
}

.cenCon {
  width: 260px;
  height: 100%;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #fff;
  border-right: 1px solid #e6e6e6;

  .itemCenter {
    margin: 10px 0;

    .cenItem {
      margin: 5px 0;
    }

    .carftItem {
      padding: 5px 0;
      font-size: 12px;

      &.active {
        background-color: #f7f8fa;

        .intax {
          background-color: #3f61f1;
          color: #ffffff;
        }

        .name_text {
          color: #3f61f1;
        }
      }

      div {
        margin: 10px;
        font-weight: 400;
        color: #999aaa;
        padding-left: 50px;
      }

      .name {
        padding-left: 0px;

        .name_text {
        }
      }

      .intax {
        display: inline-block;
        background: #f5f6f9;
        border-radius: 2px;
        padding: 5px;
        width: 40px;
        text-align: center;
        margin-right: 10px;
      }
    }
  }

  .addPeoduct {
    cursor: pointer;
    background-color: #3f61f1;
    text-align: center;
    color: #ffffff;
    border-radius: 4px;
    margin: 16px;
    padding: 10px 0;
  }
}

.PBinfo {
  width: 30%;
  margin: 0 10px;
  display: inline-block;
}

.colorPic {
  height: 100%;
  margin: 0 0 5px 0;
  overflow: hidden;

  .img_c {
    width: 250px;
    height: 250px;
    align-items: center;
    justify-content: center;
    display: flex;
    background-color: #e6e6e6;
    margin: 5px 5px;
    // text-align: center;
    position: relative;

    .text {
      position: absolute;
      top: 0;
      left: 0;
      font-size: 12px;
      font-weight: 400;
      color: #ffffff;
      line-height: 22px;
      background: #000000;
      padding: 2px 5px;
      border-radius: 0px 0px 4px 0px;
      opacity: 0.5;
    }

    .yulan {
      width: 24px;
      height: 24px;
      border-radius: 4px;
      position: absolute;
      bottom: 10px;
      right: 16px;
      z-index: 8;
      color: #fff;
      background: #7f7f7f;
    }

    .img_i {
      width: auto;
      height: auto;
      max-width: 100%;
      max-height: 100%;
    }
  }
}

.subTip {
  border-bottom: 1px #e6e6e6 solid;
  background: #f5f6f9;
  padding: 13px 16px;
  margin-bottom: 10px;
}

.formBox {
  padding: 0 16px;

  .order {
    padding: 10px 0;
  }
}

.leftCon {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  width: 320px;
  padding: 0 0 16px;
  border-radius: 4px;
  border: 1px #e6e6e6 solid;
}

.cenright {
  flex: 1;
  background-color: #ffffff;
  height: 100%;
  overflow: auto;

  .zy_add {
    margin: 16px 16px;
  }

  .zy_item {
    background: #ffffff;
    border: 1px solid #eeeeee;
    margin: 0 0 16px;

    .zy_header {
      display: flex;
      align-items: center;
      background: #f5f6f9;
      padding: 5px 5px 5px 16px;

      span {
        margin-right: 20px;
        color: #999aaa;
      }
    }

    .zy_info {
      padding: 16px;
      display: flex;
      flex-wrap: wrap;
      color: #999aaa;
      .divt {
        width: 33%;
        margin: 8px 0;
      }

      .cot {
        width: 100%;
      }

      .bigdialogTbCon {
        width: 100%;
        border: 1px solid #eeeeee;

        .ht {
          line-height: 44px;
          width: 100%;
          background: #f7f8fa;
          margin: 0;
          padding: 0 16px;

          span {
            font-weight: 600;
            color: #333333;
          }
        }
      }
    }
  }
}

.orderForm {
  height: calc(100%);
  width: 100%;
}

.mainCenter {
  height: calc(100% - 52px);
  width: 100%;
  overflow-x: hidden;
  padding: 8px;
}

.container {
  height: 100%;
  width: 100%;
}

.tagCon {
  width: 100%;
  flex: 1;
  overflow-x: hidden;
  margin: 0px 0 0 10px;
  background-color: #ffffff;

  .cginfo {
    margin: 0 16px;
  }

  .selectCon {
    line-height: 44px;
    text-align: center;
    background: #ffffff;
    border-radius: 4px 4px 0px 0px;
    border: 1px solid #e6e6e6;

    span {
      display: inline-block;
      margin: 0 32px;
      font-size: 16px;
      line-height: 44px;
      font-weight: 600;
      color: #333333;
      cursor: pointer;

      &.select {
        color: #3f61f1;
        border-bottom: 2px solid #3f61f1;
      }
    }
  }

  .tagList {
    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.05);
    border: 1px solid #e6e6e6;
    margin: 16px;

    .listNav {
      height: 44px;
      padding: 0 14px;
      background: #f5f6f9;
      border-bottom: 1px solid #e6e6e6;
    }

    .tagShow {
      background-color: #ffffff;
      border: 1px solid #e4e7ed;

      .tagBaseList {
        padding: 14px;
        padding-bottom: 8px;

        li {
          line-height: 24px;
          width: 50%;
          margin: 5px 0;
        }

        .titles {
          width: 100px;
        }
      }

      .layerTable {
        padding: 16px;
        padding-top: 0;

        .border {
          border: solid #ebeef5;
          border-width: 0 1px 0 1px;
        }
      }
    }
  }
}

.orderRemark {
  line-height: 24px;
  padding-bottom: 16px;
}

.orderContent {
  flex: 1;
}

.drgCard {
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #eeeeee;
  padding: 5px 0;
  text-align: center;
  // line-height: 44px;
  align-items: center;

  .line_div {
    width: 120px;

    &.w15 {
      width: 15%;
    }

    &.w10 {
      width: 80px;
    }

    &.mlr10 {
      margin: 0 10px 0 0;
    }
  }
}

.tableBox {
  margin-top: 10px;
  overflow: hidden;
  border: 1px #e6e6e6 solid;
  border-bottom: none;
  .bigdialogTable {
    span {
      display: inline-block;
      text-align: center;
      font-weight: bold;
      width: 120px;
      &.w15 {
        width: 15%;
      }

      &.w10 {
        width: 10%;
      }
    }
  }

  .tt {
    height: 38px;
    line-height: 38px;
    background: #f7f8fa;
    padding-left: 16px;
  }

  .title {
    border-radius: 0;
    border: 1px solid #e6e6e6;
  }
}

::v-deep .formItem {
  .el-form-item {
    margin-bottom: 0;
    color: #999aaa;
  }

  .min_item .el-form-item__label {
    line-height: 28px;
    color: #999aaa;
  }

  .min_item .el-form-item__content {
    line-height: 28px;
  }

  .el-form-item__label {
    line-height: 28px;
    color: #999aaa;
  }

  .el-form-item__content {
    line-height: 28px;
    height: 28px;
    color: #333;

    .el-input-group {
      vertical-align: initial;
      margin-top: 0;
    }
  }

  .el-select,
  .el-date-editor.el-input {
    width: 100%;
  }

  .el-textarea {
    vertical-align: middle;
  }
}
.container {
  height: 100%;
}
.permangeRg {
  border: 1px solid #e6e6e6;
  background: #fff;
  height: 100%;


  .mainTT {
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    padding: 18px 16px;
    padding-bottom: 0;
  }
  .p11 {
    padding: 10px;
  }
}
.warpper {
  height: 100%;
  overflow: hidden;

}
.cardcenter {
  height: 100%;
  width: 100%;
  overflow: hidden;
  .cardList {
    height: 100%;
    overflow: auto;
    background-color: #ebebeb;
    &:last-child {
      margin-right: 0;
    }
    .listitem {
      background: #ffffff;
      color: #999aaa;
      box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.05);
      border-radius: 4px;
      margin-bottom: 10px;
      line-height: 22px;
      border: 1px solid #eeeeee;
      .title {
        color: #333333;
      }
      .time {
        padding: 5px;
        background-color: #f5f6f9;
        &.dred {
          color: #eeeeee;
           background-color: #F57922;
        }
           &.orgen {
             color: #eeeeee;
           background-color: #E13335;
        }
      }
    }
  }
}
::v-deep .el-date-editor.el-input,
.el-date-editor.el-input__inner {
  width: 100%;
}
::v-deep .formItem {
  .el-form-item {
    margin-bottom: 0;
    color: #999aaa;
  }
  .min_item .el-form-item__label {
    line-height: 35px;
    color: #999aaa;
  }
  .min_item .el-form-item__content {
    line-height: 35px;
  }
  .el-form-item__label {
    line-height: 35px;
    color: #999aaa;
  }

  .el-form-item__content {
    line-height: 35px;

    .el-input-group {
      vertical-align: initial;
    }
  }

  .el-select,
  .el-date-editor.el-input {
    width: 100%;
  }

  .el-textarea {
    vertical-align: middle;
  }
}
::v-deep .selectdd {
  .el-input__inner {
    line-height: 30px;
    border-radius: 4px 0px 0px 4px;
  }
  .el-input__suffix {
    display: none;
  }
}
.tableBox {
    margin-top: 16px;
    border: 1px solid #e6e6e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    overflow: hidden;

    .tt {
      height: 38px;
      line-height: 38px;
      padding-left: 16px;
      background: #f7f8fa;
      border-radius: 8px 8px 0 0;
    }
  }
.permain {
  // align-items: baseline;
  line-height: 40px;
  height: 40px;
  .input {
    width: 100%;
    height: 28px;
    line-height: 28px;
    border-radius: 4px 0 0 4px;
    border: 1px solid #dcdfe6;
    span {
      display: inline-block;
      font-size: 12px;
      height: 22px;
      line-height: 22px;
      padding: 2px 5px;
      background-color: #f5f6f9;
      margin: 2px 5px;
    }
  }
  .bgc57 {
    height: 28px;
    background-color: #f5f7fa;
    border-radius: 0px 4px 4px 0px;
  }
}

.fleft {
  border-right: 1px solid #d8d8d8;
  padding: 16px;
}
.fright {
  padding: 16px;
  .count {
    display: flex;
    align-items: center;
    color: #999AAA;
  }
}
.subTip {
  border-bottom: 1px #e6e6e6 solid;
  background: #f5f6f9;
  padding: 8px 16px;
}
.spot{
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 100%;
}
</style>
<style lang="scss">
.el-loading-mask {
  top: 0;
}

.operations {
  display: flex;
  align-items: center;
}
.operations i {
  padding-right: 5px;
}

.operations > span:first-child {
  padding-right: 5px;
}

.operations > span {
  font-weight: 400;
  color: #000;
  cursor: pointer;
}

.operations > span:last-child {
  padding-left: 5px;
}
</style>
